#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QApplication>
#include <QFile>
#include <QFileDialog>
#include <QTextStream>
#include <QMessageBox>
#include <QStringList>
#include <QStringListModel>
#include "newdomaindialog.h"
#include "trie.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void addSearchHistory(const std::string &word);

private slots:
    void openNewDomainDialog();
    void openSaveFileDialog();
    void openOpenFileDialog();

    void onSearchTextChanged(const QString &text);
    void onHistoryItemClicked(const QModelIndex &index);
    void on_searchButton_clicked();

    void on_debugButton_clicked();

private:
    Ui::MainWindow *ui;

    QStringListModel *historyModel;
    Trie trie;
};
#endif // MAINWINDOW_H
